import pymysql

if __name__ == '__main__':
    conn = pymysql.connect(
        host="lib.gorio.top",
        user="root",
        password="t4hf647e",
        database="rss",
        port=17023 # 添加端口参数
    )
    cursor = conn.cursor(pymysql.cursors.DictCursor)
    # 这里应该先处理一下 数据库里面应该发送，但是因为某种异常没有发送的论文
    sql = "select site_name, paper_name, paper_links, paper_summary, paper_authors from papers where issubmit = 0"
    cursor.execute(sql)
    res = cursor.fetchall()
    result_set = {}
    if res:
        for row in res:
            site_name = row['site_name']
            if site_name not in result_set:
                result_set[site_name] = []
            result_set[site_name].append(row)
    print(result_set)